import request from '@/utils/request';

/**
 * 发送短信验证码
 * @param mobile 手机号
 * @returns
 */

export const getCodeAPI = (mobile: string) => {
  return request({
    url: '/v1_0/sms/codes/' + mobile,
  });
};

/**
 * 用户认证（登录注册）
 * @param {object} { mobile, code }
 * @returns
 */
export type LoginFormType = { mobile: string; code: string };
export const getTokenAPI = (data: LoginFormType) => {
  return request({
    url: `/v1_0/authorizations`,
    method: 'post',
    data,
  });
};
